<!DOCTYPE html>
<html>
   <head>
        <title>后台管理</title>
        <meta charset="utf-8">
        <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <!-- 引入资源文件 -->
        <#include "../../common/cms-res.html" />
   </head>
   
   <body class=""> 
  	<!-- top 导航 -->
    <#include "../../common/cms-header.html" />
	
	<!-- 菜单导航 -->
    <#include "../cms-nav.html" />

	<div class="content">
		<div class="container-fluid">
			
			<div class="block span6">
				<div class="block-body collapse in">
					<table class="table list">
						
					</table>
				</div>
			</div>
			
			<div class="row-fluid">
				<ul id="myTab" class="nav nav-tabs">
					<li class="active">
						<a href="#section" data-toggle="tab">章节</a>
					</li>
				</ul>
				
				<div id="myTabContent" class="tab-content" style="padding: 10px;">
					<!-- 课程章节-start -->
					<#include "./readSection.html" />
					<!-- 课程章节-end -->
				</div>
			</div>
			
		</div>
	</div>
	
	<script type="text/javascript">
		//过滤二级分类 
		function filterSubClassify(classify){
			var flag = false;
			$('#subClassify').find("option").each(function(i,item){
				if($(item).attr('parentCode') == classify){
					if(flag == false){
						$('#subClassify').val($(item).attr('value'));//默认选中第一个
						flag = true;
					}
					$(item).show();
				}else{
					$(item).hide();
				}
			});
		}
		$(function(){
			filterSubClassify($('#classify').val());//第一次加载的时候过滤
			$('#classify').change(function(){
				filterSubClassify($('#classify').val());
			});
		});
	
		function activeComment(courseId,type){
			var elId = 'comment';
			if(type == 1){
				elId = 'qa';
			}
			var url = '${s.base}/courseComment/pagelist.html';
			$("#" + elId).load(
				url,
				{'courseId':courseId,'type':type,'pageNum':1},
				function(){ }
			);
		}
		
		//修改课程基本信息
		function toEdit(id){
			$.ajax({
				url:'${s.base}/course/getById.html',
			    type:'POST',
			    dataType:'json',
			    data:{"id":id},
			    success:function(resp){
			    	var errcode = resp.errcode;
			    	if(errcode == 0){
			    		Modal.show('myModal');
			    		$("#myForm").fill(resp.data);
			    	}
			    }
			});
		}
	</script>
</body>
</html>
